﻿using IM.Easy.Core.Audit;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.Entity.System
{
    /// <summary>
    /// 职位信息
    /// </summary>
    [SugarTable(TableDescription = "职位信息")]
    public class SysPost : AuditSnowflakeEntity, IOrderable, IActive
    {
        /// <summary>
        /// 获取或设置岗位的名称。
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 获取或设置岗位的编码。
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 所属组织机构
        /// </summary>
        public long OrgId { get; set; }

        /// <summary>
        /// 职位描述
        /// </summary>
        public string? Desc { get; set; }

        /// <summary>
        /// 获取或设置岗位的排序序号。
        /// </summary>
        public int Order { get; set; }

        /// <summary>
        /// 启用状态
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// 所属组织机构
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(OrgId))]
        public SysDepartment Org { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(CreatedBy))]
        public SysUser CreatedUser { get; set; }
    }
}
